STEP 12: We need an if-else statement to see if our square is white.

In an if else block, if the first conditional doesn't run, then the else block runs.

  • Go to LOGIC and click on . Drag in If else INSIDE your click event.
  • Go to GRAPHICS and click on . Drag in Set Color R G B INSIDE your if block.
  • Then, drag in Set Color INSIDE your else block.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)